Skip to content

fix(android): defer autoplay until after VM instance is bound#283

Merged
mfazekas merged 1 commit into
mainfrom
fix/android-autoplay-before-databind
Jun 8, 2026
Merged

fix(android): defer autoplay until after VM instance is bound#283
mfazekas merged 1 commit into
mainfrom
fix/android-autoplay-before-databind

Conversation

@mfazekas

@mfazekas mfazekas commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #282

When dataBind and autoPlay are both active, Entry transitions evaluated with default VM values before the user's instance was bound. Now only in that case we pass autoplay=false, autoBind=false to setRiveFile and call play(settleInitialState=false) so the state machine is created without advancing Entry. The first Choreographer frame advances with the user's VM instance already bound. All other cases (autoPlay={false}, no data binding) keep the original behavior.

Also bumps rive-android from 11.4.0 to 11.6.1.

Reproducer: https://rive.app/community/files/27852-52628-on-entry-actions-reproducer

Test plan

  • Harness test entry-databinding.harness.tsx sets input=42 via VM instance, mounts with autoPlay=true + dataBind, asserts inputOnEntry=42 (Entry copied input into inputOnEntry)
  • iOS: pass (was already correct)
  • Android: pass (was failing before fix -- inputOnEntry stayed at default -100)

@mfazekas
mfazekas requested a review from HayesGordon June 3, 2026 06:28
HayesGordon
HayesGordon previously approved these changes Jun 3, 2026

@HayesGordon HayesGordon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@mfazekas
mfazekas force-pushed the fix/android-autoplay-before-databind branch from 7646d10 to c67eebb Compare June 3, 2026 07:51
Entry transitions evaluated with default VM values before the user's
instance was bound. Use settleInitialState=false when data binding is
active so the state machine is created without advancing, then bind,
then let the Choreographer frame advance with correct values.

Also bumps rive-android from 11.4.0 to 11.6.1.
@mfazekas
mfazekas force-pushed the fix/android-autoplay-before-databind branch from c67eebb to dee54da Compare June 5, 2026 12:55
@mfazekas
mfazekas enabled auto-merge (squash) June 5, 2026 14:31
@mfazekas
mfazekas requested a review from HayesGordon June 5, 2026 14:31
@mfazekas
mfazekas merged commit f600a47 into main Jun 8, 2026
9 checks passed
@mfazekas
mfazekas deleted the fix/android-autoplay-before-databind branch June 8, 2026 09:48
mfazekas pushed a commit that referenced this pull request Jun 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.11](v0.4.10...v0.4.11)
(2026-06-08)


### Bug Fixes

* **android:** defer autoplay until after VM instance is bound
([#283](#283))
([f600a47](f600a47))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: data-bound state machine evaluates Entry with default VM values before user instance is bound (iOS/Android parity)

2 participants